package com.wmh.baseservice.system.controller;

import com.wmh.baseservice.common.utils.FileUtil;
import com.wmh.baseservice.common.utils.returnbody.ReturnBody;
import com.wmh.baseservice.system.service.SysBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import java.io.File;

//@ApiIgnore

@RestController
@RequestMapping("system/public")
public class SysPublicController {

    @ApiOperation("上传语音")
    @PostMapping("uploadFile")
    @ApiImplicitParams({
             @ApiImplicitParam(paramType = "query", dataTypeClass = Long.class, name = "id", value = "id", required = false),
     })
    public String uploadFile(MultipartFile audio){
        String file = FileUtil.upload("sys/", audio, "file");
        return ReturnBody.success(file);
    }

}
